package com.gitee.srurl.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gitee.srurl.core.annotation.Login;
import com.gitee.srurl.core.domain.SusUserDomain;
import com.gitee.srurl.core.domain.SusVisitorRecordDomain;
import com.gitee.srurl.core.service.ISusVisitorRecordService;
import com.gitee.srurl.core.util.PageQuery;
import com.gitee.srurl.system.util.PageUtil;
import com.gitee.srurl.system.util.response.PageResponse;
import com.gitee.srurl.system.util.response.R;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zxw
 * @date 2023/5/3 12:12
 */
@RestController
@RequestMapping("visit_record")
@RequiredArgsConstructor
public class VisitRecordController {

    private final ISusVisitorRecordService visitorRecordService;

    @Login
    @GetMapping("list")
    public R<PageResponse<SusVisitorRecordDomain>> list(PageQuery pageQuery, SusVisitorRecordDomain visitorRecordDomain) {

        IPage<SusVisitorRecordDomain> page = visitorRecordService.getList(pageQuery, visitorRecordDomain);
        return R.page(PageUtil.mybatisPageTransfer(page));
    }
}
